package com.daoyintech.entity.weixin.response;

import com.daoyintech.utils.XStreamUtil;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import me.chanjar.weixin.common.util.xml.XStreamCDataConverter;
import java.io.Serializable;

/**
 * Created by xuzhaolin on 15/12/28.
 */
@XStreamAlias("xml")
public class WxXmlRedEnvelope implements Serializable{

    @XStreamAlias("return_code")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String return_code;

    @XStreamAlias("return_msg")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String return_msg;

    @XStreamAlias("result_code")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String result_code;

    @XStreamAlias("err_code")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String err_code;

    @XStreamAlias("err_code_des")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String err_code_des;

    @XStreamAlias("mch_billno")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String mch_billno;

    @XStreamAlias("sp_ticket")
    @XStreamConverter(value=XStreamCDataConverter.class)
    private String sp_ticket;


    public String getReturn_code() {
        return return_code;
    }

    public void setReturn_code(String return_code) {
        this.return_code = return_code;
    }

    public String getReturn_msg() {
        return return_msg;
    }

    public void setReturn_msg(String return_msg) {
        this.return_msg = return_msg;
    }

    public String getResult_code() {
        return result_code;
    }

    public void setResult_code(String result_code) {
        this.result_code = result_code;
    }

    public String getErr_code() {
        return err_code;
    }

    public void setErr_code(String err_code) {
        this.err_code = err_code;
    }

    public String getErr_code_des() {
        return err_code_des;
    }

    public void setErr_code_des(String err_code_des) {
        this.err_code_des = err_code_des;
    }

    public String getMch_billno() {
        return mch_billno;
    }

    public void setMch_billno(String mch_billno) {
        this.mch_billno = mch_billno;
    }

    public String getSp_ticket() {
        return sp_ticket;
    }

    public void setSp_ticket(String sp_ticket) {
        this.sp_ticket = sp_ticket;
    }


    public static WxXmlRedEnvelope fromXml(String xml){
        XStream xstream = XStreamUtil.getInstance();
        xstream.processAnnotations(WxXmlRedEnvelope.class);
        return (WxXmlRedEnvelope)xstream.fromXML(xml);

//        return
    }



}
